﻿@model PagedList<RBS.Core.Model.Hotel.H_Hotel_Cookbook>

@using Webdiyer.WebControls.Mvc
@using RBS.Web.Hotel.Service

@{
    ViewBag.Title = "菜谱管理";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
} 
<script type="text/javascript"> 
    var api = frameElement.api, W = api.opener; 
    api.button({
        id: 'valueOk',
        name: '确定',
        callback: ok
    }); 
   function SelectCookBook(a, b) {
      // alert(a + b);
       W.document.getElementById('DenominationDesc').value = a;
       W.document.getElementById('Denomination').value = b; 
       $("#scookbook").html(a);
   } 
    function ok() {
        
    };
</script> 
 
<div class="toolbar-wrap">
    <div id="floatHead" class="toolbar">
        <div class="l-list">
            <ul class="icon-list"> 
                <li>你选择的是： </li> <li id="scookbook"> </li> 
            </ul>
        </div>
        <div class="r-list">
            @using (Html.BeginForm("SelectCookBook", "Cookbook", new RouteValueDictionary { { "id", "" } }, FormMethod.Get))
            {
                <input id="kword" name="kword" type="text" class="keyword" value="@Request.QueryString["kword"]"/>
                <input type="submit" value="查询" class="btn-search" accesskey="S" /> 
            }
        </div>
    </div>
</div>
 

<!--列表-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr> 
        <th align="left">菜谱图片</th>
        <th align="left">名称</th>
        <th align="left">单价</th>
        <th align="left">分类</th>  
        <th width="8%">操作</th>
    </tr>
    @if (null != ViewData.Model)
    {
        foreach (var item in ViewData.Model)
        {
        <tr> 
            <td align="left">
                <img src="~/@item.DishImages" width="50" height="40"/>   <input id="hidId" type="hidden" value="@item.Id"/>
            </td>
            <td align="left">
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td align="left">
                @Html.DisplayFor(modelItem => item.Price)元/@Html.DisplayFor(modelItem => item.Unit)  
            </td>
            <td align="left">
                 @(new RBS.Core.BLL.H_Hotel_CookbookCategory().GetModelByCache(item.CategoryId).Name) 
            </td> 
            <td align="center">
            <a href="javascript:;" onclick="SelectCookBook('@item.Name',@item.Id)">选择</a>
            </td>
        </tr>
        }
    }
</table>
<!--/列表-->
<!--内容底部-->
<div class="line20">
</div>
<div class="pagelist">
    <div class="l-btns">
        <span>显示</span> <span>10 条/页</span><span>共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</span>
    </div>
    @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "pageIndex", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false, CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>" }, new { id = "PageContent", @class = "default" })
    @section Scripts{@{Html.RegisterMvcPagerScriptResource();}}
</div>
<!--/内容底部--> 
<!--/列表-->



